﻿using B.S.BasicData.Api.Read.Application.Command.BaoBiao;
using B.S.BasicData.Api.Read.DTO;
using B.S.BasicData.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BasicData.Api.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BaoBiaoController : ControllerBase
    {
        private readonly IMediator mediator;

        public BaoBiaoController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 获取报表所有信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        [Authorize]
        public Task<ApiResult<List<BaoBiaoDTO>>> GetZongBaoBiao([FromQuery]GetZongBaoBiaoCommand request)
        {
            return mediator.Send(request);
        }
        /// <summary>
        /// 获取报表明细信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        [Authorize]
        public Task<ApiResult<List<BaoMingDTO>>> GetMingBao([FromQuery]GetMingxiBaoCommand request)
        {
            return mediator.Send(request);
        }
    }
}
